package com.example.guide.validdata;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

@Configuration
@EnableWebMvc
public class MyWebMvcConfig implements WebMvcConfigurer {

    /** 自定义参数解析实现
     * 1 注释 @CustomParam
     * 2，参数解析实现 CustomParamResoler implements HandlerMethodArgumentResolver
     * 3, 参数解析实现 注册
     *
     * */
    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
        resolvers.add(new CustomParamResoler());
    }
}
